.container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 顶部信息栏 */
.header {
  padding: 15px 20px;
  height: 60px;
  background-color: white;
  border-bottom: 1px solid #eee;
  text-align: center;
  position: relative;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.backto {
  position: absolute;
  left: 20px;
  top: 15px;
  width: 30px;
  height: 30px;
  background-color: #f7f4f2;
  text-align: center;
  line-height: 30px;
  border-radius: 50px;
}

.back {
  font-size: 15px;
}

.title {
  font-size: 18px;
  font-weight: bold;
  margin: 1;
  color: #333;
}

.info {
  position: absolute;
  right: 20px;
  top: 15px;
}

.version {
  color: #4CAF50;
  font-weight: 500;
}

/* 主要内容区域 - 关键修改部分 */
.mainContent {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 0; /* 移除内边距 */
  background-color: #f7f4f2;
  display: flex;
  flex-direction: column;
}

.messageContainer {
  width: 90%;
  padding: 15px 20px; /* 只在容器添加内边距 */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 消息气泡基础样式 */
.messageBubble {
  position: relative;
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 用户消息气泡 */
.userBubble {
  align-self: flex-end;
  background-color: #9bb167;
  color: white;
  border-top-right-radius: 4px;
}

/* AI消息气泡 */
.aiBubble {
  align-self: flex-start;
  background-color: #e8ddd9;
  color: #333;
  border-top-left-radius: 4px;
}

/* 气泡箭头 */
.messageBubble::after {
  content: '';
  position: absolute;
  top: 15px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  /* background-color: #e8ddd9; */
}

.userBubble::after {
  right: -8px;
  border-left-color: #9bb167;
  border-right: 0;
}

.aiBubble::after {
  left: -8px;
  border-right-color: #e8ddd9;
  border-left: 0;
}

/* 消息元信息 */
.messageMeta {
  font-size: 11px;
  color: rgb(26, 25, 25);
  margin-top: 4px;
  text-align: right;
}

/* 底部输入区域 */
.inputArea {
  width: 90%;
  padding: 15px;
  background-color: white;
  border-top: 1px solid #eee;
  position: fixed;
  bottom: 0;
}

.inputContainer {
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  border-radius: 20px;
  padding: 8px 15px;
}

.messageInput {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  font-size: 15px;
  outline: none;
}

.icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.iconButton {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 20px;
  color: #666;
}

.sendButton {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 15px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* 加载中的气泡样式 */
.loadingBubble {
  opacity: 0.8;
}

.loadingDots {
  display: inline-flex;
  gap: 2px;
}

.loadingDots span {
  animation: dotPulse 1.5s infinite ease-in-out;
  animation-delay: calc(var(--order) * 0.2s);
}

.loadingDots span:nth-child(1) { --order: 1; }
.loadingDots span:nth-child(2) { --order: 2; }
.loadingDots span:nth-child(3) { --order: 3; }

/* 语音消息样式 */
.voiceMessage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voicePlayer {
  width: 100%;
  max-width: 250px;
  margin-top: 5px;
}